#pragma once

class Triangulation {
  vector<Point> p_list;
public:
  Triangulation(vector<Point> p_list);
  vector<Face*> diamond_test();
  FT weight(CGALTriangulation &t);
  FT area(CGALTriangulation &t);
  FT average_distance();
  int degree(CGALTriangulation &t, CGALTriangulation::Cell_handle &cell, int s, int e);
  int degree(CGALTriangulation &t, const CGALTriangulation::Edge &edge);
  static bool sort_comparator_asc(Point p1, Point p2);
  static bool sort_comparator_desc(Point p1, Point p2);
  bool angle_flip(CGALTriangulation &t, CGALTriangulation::Facet f);
  bool face_flip(CGALTriangulation &t, CGALTriangulation::Facet f);
  bool edge_flip(CGALTriangulation &t, CGALTriangulation::Facet f, bool is_area);
  void alter_for_better(CGALTriangulation &t, bool area);
  template <class T>
  void run_triangulation(bool is_area = false);
  void run();
};
